package cn.com.nes.site.service.project.dto;

import cn.com.nes.mybatis.agent.project.entity.ProjectServiceUserAuth;
import cn.com.nes.site.entity.em.project.ProjectServiceUserEnableEnum;
import cn.com.nes.site.entity.em.project.ProjectServiceUserTypeEnum;
import lombok.Data;

@Data
public class ProjectServiceUserDTO {

    /**
     * 主键ID
     */
    private Long id;

    /**
     * 服务人员ID
     */
    private Long serviceUserId;

    /**
     * 易修用户ID
     */
    private Long easyRepairUserId;

    /**
     * 长效管护用户ID
     */
    private Long callcenterUserId;

    /**
     * 服务人员名称
     */
    private String serviceUserName;

    /**
     * 服务人员手机号
     */
    private String serviceUserPhone;

    /**
     * 服务人员用户类别：0-施工人员，1-施工负责人
     */
    private Integer serviceUserType;

    /**
     * 服务人员用户类别名称
     */
    private String serviceUserTypeName;

    /**
     * 服务人员启用标识：0-启用，1-禁用
     */
    private Integer serviceUserEnableIdentity;

    /**
     * 服务人员启用标识名称
     */
    private String serviceUserEnableIdentityName;

    /**
     * 服务区域行政区划代码
     */
    private String serviceAreaCode;

    /**
     * 服务区域行政区划名称
     */
    private String serviceAreaCodeName;

    /**
     * 部门ID
     */
    private String departmentId;

    /**
     * 部门名称
     */
    private String departmentName;

    public static ProjectServiceUserDTO from (ProjectServiceUserAuth projectServiceUserAuth) {
        ProjectServiceUserDTO projectServiceUserDTO = new ProjectServiceUserDTO();
        projectServiceUserDTO.setId(projectServiceUserAuth.getId());
        projectServiceUserDTO.setServiceUserId(projectServiceUserAuth.getServiceUserId());
        projectServiceUserDTO.setServiceUserType(projectServiceUserAuth.getServiceUserType());
        projectServiceUserDTO.setServiceUserTypeName(ProjectServiceUserTypeEnum.getVal(projectServiceUserAuth.getServiceUserType()));
        projectServiceUserDTO.setServiceUserEnableIdentity(projectServiceUserAuth.getEnableIdentity());
        projectServiceUserDTO.setServiceUserEnableIdentityName(ProjectServiceUserEnableEnum.getVal(projectServiceUserAuth.getEnableIdentity()));
        projectServiceUserDTO.setDepartmentId(projectServiceUserDTO.getDepartmentId());
        return projectServiceUserDTO;
    }

}
